package com.xuecheng.content.controller;

import com.xuecheng.commons.model.dto.BindTeachplanMediaDto;
import com.xuecheng.commons.model.dto.BindTeachplanWorkDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.web.bind.annotation.*;
import com.xuecheng.content.service.TeachplanWorkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class TeachplanWorkController {

    @Autowired
    private TeachplanWorkService  teachplanWorkService;
    // 作业绑定
    @PostMapping("/teachplan/work/association")
    public ResponseResult association(@RequestBody BindTeachplanWorkDto dto) {
        return teachplanWorkService.association(dto);
    }
    //删除课程计划的媒资数据
    @DeleteMapping("/teachplan/work/{teachplanWorkId}")
    public ResponseResult deletework(Long courseBaseId,@PathVariable("teachplanWorkId") Long teachplanWorkId){
        //调用方法
        return  teachplanWorkService.deletework(courseBaseId,teachplanWorkId);
    }
}
